import Vue from "vue";
import App from "./App";
import {
	router,
	RouterMount
} from "@/nxTemp/router";
import store from "@/nxTemp/store";
import uView from "@/uview-ui";
import nxTemp from "@/nxTemp";

Vue.prototype.$imgUrl = (url) => {
	return ("https://wx93.cn/upload/image" + url);
  };
// async function bootstrap() {
	App.mpType = "app";
	//引入路由
	Vue.use(router);
	// 引入全局uView

	Vue.use(uView);
	// 加载nxTemp
	Vue.use(nxTemp);

	const app = new Vue({
		store,
		...App
	});
	// #ifdef H5
	RouterMount(app, router, "#app");
	// #endif
	// #ifndef H5
	app.$mount();
	// #endif
// }
import $http from '@/nxTemp/config/requestConfig'
import { uploadFile} from '@/nxTemp/config/uploadConfig'

Vue.prototype.$http = $http;
Vue.prototype.$uploadFile = uploadFile;

// #ifndef VUE3



import AppDialog from '@/components/app-dialog'
import {toast,showConfirm,show,hide,error} from "@/common/common.js"
Vue.use(uView);
Vue.component('app-dialog', AppDialog);
Vue.prototype.toast = toast
Vue.prototype.showLoading = show;
Vue.prototype.hideLoading = hide;
Vue.prototype.errorLoading = error;
Vue.prototype.showConfirm = showConfirm
Vue.prototype.$bus = new Vue() // event Bus 用于无关系组件间的通信。
  
uni.$u.setConfig({
	config: {
		unit: 'rpx'
	}
})
Vue.config.productionTip = false
App.mpType = 'app'


// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif